package com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class RestFulController {

    //原来的：http://localhost:9999/test1?a=2&b=6
    //现在的：http://localhost:9999/test1/26
    @RequestMapping("/test1/{a}/{b}")
    public String test1(@PathVariable int a,@PathVariable int b, Model model){
        model.addAttribute("msg","结果为："+(a+b));
        return "test";
    }
}
